package de.gwtprime.client.activities;


import com.google.gwt.activity.shared.AbstractActivity;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.place.shared.Place;
import com.google.gwt.user.client.ui.AcceptsOneWidget;

import de.gwtprime.client.ClientFactory;
import de.gwtprime.client.places.ImpressumPlace;
import de.gwtprime.client.util.AppUtils;
import de.gwtprime.client.views.ImpressumView;
import de.gwtprime.client.viewsStatic.NavigationViewImpl.Section;

public class ImpressumActivity extends AbstractActivity implements ImpressumView.Presenter{

	private ClientFactory clientFactory;
	
	private String name;
	
	public ImpressumActivity(ImpressumPlace place, ClientFactory clientFactory){
		
		this.name = place.getName();
		this.clientFactory = clientFactory;
	}
	
	@Override
	public void start(AcceptsOneWidget panel, EventBus eventBus) {

		AppUtils.trackPageview("ImpressumView");
		
		clientFactory.getNavigationView().activateSection(Section.USER_ACCOUNT);
		ImpressumView impressumView = clientFactory.getImpressumView();
		impressumView.setName(name);
		impressumView.setPresenter(this);
		
		panel.setWidget(impressumView.asWidget());
	}
	


	@Override
	public void goTo(Place place) {
		clientFactory.getPlaceController().goTo(place);
		
	}

}
